package com.example.service.impl;

import com.example.mapper.DeptLogMapper;
import com.example.pojo.DeptLog;
import com.example.service.DeptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

    @Service
    public class DeptLogServiceImpl implements DeptLogService {

        @Autowired
        private DeptLogMapper deptLogMapper;

        @Transactional(propagation = Propagation.REQUIRES_NEW)//调用insert方法时，会开启一个新的事务
        @Override
        public void insert(DeptLog deptLog) {
            deptLogMapper.insert(deptLog);
        }
}
